package com.yami.shop.controller;


import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.impl.RongYunConversationServiceImpl;
import com.yami.shop.vo.ConversationRongVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会话模块
 *
 * @author RongCloud
 * @version 3.0.0
 */
@RestController
@RequestMapping("/account/im/conversat")
@Schema(description = "app-钱包IM会话模块")
public class RongYunConverController {

    @Autowired
    private RongYunConversationServiceImpl rongYunConversationService;

    /**
     * 设置用户某会话接收新消息时是否进行消息提醒。
     *
     * @param conversationRongVo 会话信息 其中type(必传)
     * @return ResponseResult
     **/
    @PostMapping("/conversation_notification_set")
    @Operation(summary =  " 设置用户某会话接收新消息时是否进行消息提醒", description = " 设置用户某会话接收新消息时是否进行消息提醒")
    public ServerResponseEntity<String> mute(@RequestBody ConversationRongVo conversationRongVo) throws Exception {
        return rongYunConversationService.mute(conversationRongVo);
    }

    /**
     * 查询会话消息免打扰方法。
     *
     * @param conversationRongVo 会话信息 其中type(必传)
     * @return ResponseResult
     **/
    @PostMapping("/conversation_notification_get")
    @Operation(summary =  " 查询会话消息免打扰方法", description = " 查询会话消息免打扰方法")
    public ServerResponseEntity<String> get(@RequestBody ConversationRongVo conversationRongVo) {
        return rongYunConversationService.get(conversationRongVo);
    }

    /**
     * 解除用户某会话消息免打扰
     *
     * @param conversationRongVo 会话信息 其中type(必传)
     * @return ResponseResult
     **/
    @PostMapping("/conversation_notification_remove")
    @Operation(summary =  " 解除用户某会话消息免打扰", description = " 解除用户某会话消息免打扰")
    public ServerResponseEntity<String> unMute(@RequestBody ConversationRongVo conversationRongVo) throws Exception {
        return rongYunConversationService.unMute(conversationRongVo);
    }
}
